﻿@model MvcSimplyCleverPart2.Models.AddressViewModel

@{
    ViewBag.Title = "Step 2";
}

@using (Html.BeginForm("Save", "Contact"))
{ 
    <div class="addressForm">
        <div class="row">
            <div class="label">@Html.LabelFor(m => m.CountryCode)</div>
            <div class="input">

                @Html.DropDownListFor(m => m.CountryCode, ViewHelper.GetCountries(Model.CountryCode), new { id = "CountryCode" })

            </div>
        </div>
        <div class="row">
            <div class="label">@Html.LabelFor(m => m.Line1)</div>
            <div class="input">
                @Html.TextBoxFor(m => m.Line1)
                @Html.TextBoxFor(m => m.Line2) <br/>
                @Html.ValidationMessageFor(m => m.Line1)
            </div>
        </div>

        <div class="row">
            <div class="label">@Html.LabelFor(m => m.City)</div>
            <div class="input">
                @Html.TextBoxFor(m => m.City)<br/>
                @Html.ValidationMessageFor(m => m.City)
            </div>
        </div>
        <div class="row">
            <div class="label">@Html.LabelFor(m => m.County)</div>
            <div class="input">
                @Html.TextBoxFor(m => m.County)<br/>
                @Html.ValidationMessageFor(m => m.County)
            </div>
        </div>
        <div class="row">
            <div class="label">@Html.LabelFor(m => m.StateCode)</div>
            <div class="input">
                @Html.DropDownListFor(m => m.StateCode, ViewHelper.GetStates(Model != null ? Model.StateCode : string.Empty))
            </div>
        </div>
        <div class="row">
            <div class="label">@Html.LabelFor(m => m.ZipCode)</div>
            <div class="input">
                @Html.TextBoxFor(m => m.ZipCode)<br/>
                @Html.ValidationMessageFor(m => m.ZipCode)
            </div>
        </div>

        <input type="submit" value="Save">
    </div>
}
